package com.ease.core.events {
   import flash.events.Event;

   [Response(name="{RETURN_ID}", type="com.ease.framework.CommandCompletionEvent")]
   public class ViewOperationEvent extends Event {
      public static const REQUEST_ID:String = "ViewEvent_Request";
      public static const RETURN_ID:String = "ViewEvent_Return";

      public static const TYPE_OPEN_VIEW:String = "openView";
      public static const TYPE_CLOSE_VIEW:String = "closeView";

      private var _viewIds:Array = null;
      private var _spec:Object = null;
      private var _actionType:String = null;
      public function ViewOperationEvent(viewIds:Array, spec:Object = null,
                                actionType:String = TYPE_OPEN_VIEW, type:String = null) {
         var typeId : String = type;
         if( type == null ) {
            typeId = REQUEST_ID;
         }
         super(typeId);
         _viewIds = viewIds;
         _actionType = actionType;
         _spec = spec;
      }

      public override function clone():Event {
         var event:ViewOperationEvent = new ViewOperationEvent(viewIds, spec, actionType, type);
         return event;
      }

      public function get spec():Object {
         return _spec;
      }

      public function get viewIds():Array {
         return _viewIds;
      }

      public function get actionType():String {
         return _actionType;
      }
   }
}